<?php
$arrStaffPermission = $_SESSION['arrStaffPermission'];
//Check permission
$sAdministratorSystem = "";
$sAdministratorSystem1 = "";
$sAdministratorSystem2 = "";
if (isset($arrStaffPermission['CAP_NHAT_DM_DOI_TUONG'])) {
    $sAdministratorSystem1 = $arrStaffPermission['CAP_NHAT_DM_DOI_TUONG'];
}
if (isset($arrStaffPermission['CAP_NHAT_LOAI_DM'])) {
    $sAdministratorSystem2 = $arrStaffPermission['CAP_NHAT_LOAI_DM'];
}
$sAdministratorSystem = $sAdministratorSystem1 || $sAdministratorSystem2;
$permisstionSystem = Efy_Init_Config::_setPermisstionSystem(1) || Efy_Init_Config::_setPermisstionSystem(2);
?>
<!-- Bài giảng -->
<!-- <div><?php echo $_SESSION['INFORMATION_STAFF_LOGIN'];?></div> -->
<ul id = "sub_top_training" class = "sub_top_menu"> 
    <li id = "sub_top_training_doc_training">
        <a href="<?php echo $this->baseUrl; ?>../mtl/training/index/" onclick="{selectLeft(this,'TRAINING','index');return false;}" >Cập nhật tài liệu</a>              
    </li>
    <!--<li id = "sub_top_training_doc_synthesis">
        <a href="#" onclick="{selectLeft(this,'TRAINING','synthesis');return false;}" >Tổng hợp dữ liệu </a>                      
    </li>-->
</ul>
<!--QUAN TRI-->
<ul id = "sub_top_admin" class = "sub_top_menu">
    <li id = "left_admin_listtype_index">
        <a href="<?php echo $this->baseUrl; ?>../listxml/listtype/index/">Loại danh mục</a>
    </li>
    <?php if ($_SESSION['STAFF_PERMISSTION'] == 'ADMIN_SYSTEM'){?>
    <li id = "left_admin_list_index">
        <a href="<?php echo $this->baseUrl; ?>../listxml/list/index/">Danh mục đối tượng</a>
    </li>
    <?}?>
    <li id = "left_admin_tree_training">
        <a href="<?php echo $this->baseUrl; ?>../listxml/tree/training/">Cây tư liệu</a>
    </li>    
    <?php if ($_SESSION['STAFF_PERMISSTION'] == 'ADMIN_SYSTEM'){?>  
    <li id = "left_admin_permission_index">
        <a href="<?php echo $this->baseUrl; ?>../listxml/permission/index/">Danh mục quyền</a>
    </li>
    <?}?>    
</ul>
<script type = "text/javascript"><?php
    $sCurrentModulCode = $this->currentModulCode;
    $getModulLeft = $this->getStatusLeftMenu;
    $scurrentModulCodeForLeft = $this->currentModulCodeForLeft;
    ?>
    CurrentModulCode = '<?= $sCurrentModulCode ?>';	
    getModulLeft = '<?= $getModulLeft ?>';
    currentModulCodeForLeft = '<?= $scurrentModulCodeForLeft ?>';
    setleftmenu(CurrentModulCode,currentModulCodeForLeft);
    function setleftmenu(CurrentModulCode,currentModulCodeForLeft){   
    // alert(currentModulCodeForLeft)     ;
        $('ul.sub_top_menu').hide();
        $('ul.sub_top_menu li').removeClass('visited');        
        try{
            switch(CurrentModulCode){
                case 'TRAINING':                    
                    $('ul#sub_top_training').show();
                    switch(currentModulCodeForLeft){
                        case "index":
                            $('li#sub_top_training_doc_training').addClass('visited');                        
                            break;
                        case "comment":
                            $('li#sub_top_training_doc_comment').addClass('visited');                        
                            break;
                        case "commented":
                            $('li#sub_top_training_doc_commented').addClass('visited');                        
                            break;
                        case "approve":
                            $('li#sub_top_training_doc_approve').addClass('visited');                        
                            break;
                        case "approved":
                            $('li#sub_top_training_doc_approved').addClass('visited');                        
                            break;
                        case "synthesis":
                            $('li#sub_top_training_doc_synthesis').addClass('visited');                        
                            break;
                        default:
                            $('li#sub_top_training_doc_training').addClass('visited');                        
                    }
                    break;
                case 'SEARCH':
                    $('ul#sub_top_search').show();
                    switch(currentModulCodeForLeft){
                        case "training":
                            $('li#sub_top_search_doc_training').addClass('visited');                        
                            break;
                        default:
                            $('li#sub_top_search_doc_training').addClass('visited');                        
                    }
                    break;
                case 'ADMIN':
                    $('ul#sub_top_admin').show();
                    switch(currentModulCodeForLeft){
                        case "listtype":
                            $('li#left_admin_listtype_index').addClass('visited');                        
                            break;
                        case "list":
                            $('li#left_admin_list_index').addClass('visited');
                            break;
                        case "training":
                            $('li#left_admin_tree_training').addClass('visited');
                            break;
                        case "permission":
                            $('li#left_admin_permission_index').addClass('visited');                                                                        
                            break;
                        case "permission_insurance_uni":
                            $('li#left_admin_permission_insurance_unit_index').addClass('visited');                                                                        
                            break;
                        case "backup":
                            $('li#left_admin_backup_index').addClass('visited');                                                                          
                            break;
                        case "recordtype":
                            $('li#left_admin_recordtype_index').addClass('visited');                                                                          
                            break;
                        default:
                            $('li#left_admin_listtype_index').addClass('visited');                        
                    }
                    break;
            }
        }catch(e){;}	
    }
</script>